﻿namespace WinForms
{
    using Bll.Guest;
    using Bll.Sales;
    using Bll.Systems;
    using Model.Guest;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Threading;
    using System.Windows.Forms;
    using WinForms.Properties;

    public class FrmStartup : Form
    {
        private DataGridViewTextBoxColumn AllMoney;
        private IContainer components = null;
        private DataGridViewTextBoxColumn CreateTime;
        private DataGridView DataGridList;
        private DataGridView DataGridListNews;
        private DataGridView DataGridSalePayMent;
        private DataNewsItemCallback DatNewsCallback;
        private DataGridViewTextBoxColumn GuestId;
        private DataGridViewTextBoxColumn id;
        private DataGridViewTextBoxColumn Infos;
        private Label label1;
        private Label label2;
        private Label lblTitle;
        private DataGridViewTextBoxColumn NewsCreateTime;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_Left;
        private Panel pan_LeftJianGe;
        private Panel pan_Lefts;
        private Panel pan_NewDock;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel1;
        private Panel panel10;
        private Panel panel11;
        private Panel panel12;
        private Panel panel13;
        private Panel panel14;
        private Panel panel15;
        private Panel panel16;
        private Panel panel17;
        private Panel panel18;
        private Panel panel19;
        private Panel panel2;
        private Panel panel20;
        private Panel panel21;
        private Panel panel22;
        private Panel panel23;
        private Panel panel24;
        private Panel panel25;
        private Panel panel26;
        private Panel panel3;
        private Panel panel4;
        private Panel panel5;
        private Panel panel6;
        private Panel panel7;
        private Panel panel8;
        private Panel panel9;
        private DataGridViewTextBoxColumn SalesCreateTime;
        private DataGridViewTextBoxColumn Titles;
        private DataGridViewTextBoxColumn ToMeetMoney;
        private DataGridViewTextBoxColumn UserId;

        public FrmStartup()
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.DataGridList.AutoGenerateColumns = false;
            this.DataGridSalePayMent.AutoGenerateColumns = false;
            this.DataGridListNews.AutoGenerateColumns = false;
        }

        private void AddListBoxItem()
        {
            if (this.DataGridListNews.InvokeRequired)
            {
                base.Invoke(this.DatNewsCallback, null);
            }
            else
            {
                this.LoadNews();
            }
        }

        private void DataGridListNews_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if ((e.RowIndex != -1) && (e.ColumnIndex == this.DataGridListNews.Columns["Titles"].Index))
            {
                int rowIndex = e.RowIndex;
                string s = this.DataGridListNews.Rows[rowIndex].Cells[0].Value.ToString();
                if (s != "")
                {
                    NewsEnt model = NewsBll.GetModel(int.Parse(s));
                    if (model != null)
                    {
                        try
                        {
                            Process.Start("IEXPLORE.EXE", model.LinkAddress);
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }
        }

        protected void DataZhuanHuan(ref DataTable dt)
        {
            dt.Columns["GuestId"].ColumnName = "GuestId1";
            dt.Columns["UserId"].ColumnName = "UserId1";
            dt.Columns.Add("UserId");
            dt.Columns.Add("GuestId");
            foreach (DataRow row in dt.Rows)
            {
                GuestEnt model = GuestBll.GetModel(int.Parse(row["GuestId1"].ToString()));
                if (model != null)
                {
                    row["GuestId"] = model.GuestName;
                }
                DataRow[] rowArray = PublicAppliction.UserDt.Select("userid=" + row["UserId1"].ToString());
                if (rowArray.Length > 0)
                {
                    row["UserId"] = rowArray[0]["UserName"].ToString();
                }
            }
            dt.Columns.Remove("UserId1");
            dt.Columns.Remove("GuestId1");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        protected void DownNews()
        {
            new Thread(new ThreadStart(this.DownNewsDb)) { Name = "DownNews", IsBackground = true }.Start();
        }

        private void DownNewsDb()
        {
            if (NewsBll.UpdateYeJieDongTai())
            {
                this.AddListBoxItem();
            }
        }

        private void FrmStartup_Load(object sender, EventArgs e)
        {
            this.LoadNewsSales();
            this.LoadNoSalesMoney();
            this.LoadNews();
            this.DatNewsCallback = new DataNewsItemCallback(this.AddListBoxItem);
            this.DownNews();
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            DataGridViewCellStyle style12 = new DataGridViewCellStyle();
            DataGridViewCellStyle style13 = new DataGridViewCellStyle();
            DataGridViewCellStyle style14 = new DataGridViewCellStyle();
            DataGridViewCellStyle style15 = new DataGridViewCellStyle();
            DataGridViewCellStyle style16 = new DataGridViewCellStyle();
            DataGridViewCellStyle style17 = new DataGridViewCellStyle();
            DataGridViewCellStyle style18 = new DataGridViewCellStyle();
            DataGridViewCellStyle style19 = new DataGridViewCellStyle();
            DataGridViewCellStyle style20 = new DataGridViewCellStyle();
            DataGridViewCellStyle style21 = new DataGridViewCellStyle();
            DataGridViewCellStyle style22 = new DataGridViewCellStyle();
            DataGridViewCellStyle style23 = new DataGridViewCellStyle();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmStartup));
            this.panel1 = new Panel();
            this.panel2 = new Panel();
            this.panel3 = new Panel();
            this.panel4 = new Panel();
            this.panel5 = new Panel();
            this.pan_Dock = new Panel();
            this.pan_NewDock = new Panel();
            this.DataGridListNews = new DataGridView();
            this.id = new DataGridViewTextBoxColumn();
            this.Titles = new DataGridViewTextBoxColumn();
            this.Infos = new DataGridViewTextBoxColumn();
            this.NewsCreateTime = new DataGridViewTextBoxColumn();
            this.pan_Lefts = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.panel8 = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.panel7 = new Panel();
            this.pan_Left = new Panel();
            this.panel6 = new Panel();
            this.panel26 = new Panel();
            this.DataGridSalePayMent = new DataGridView();
            this.GuestId = new DataGridViewTextBoxColumn();
            this.SalesCreateTime = new DataGridViewTextBoxColumn();
            this.AllMoney = new DataGridViewTextBoxColumn();
            this.panel25 = new Panel();
            this.panel24 = new Panel();
            this.panel23 = new Panel();
            this.panel22 = new Panel();
            this.panel18 = new Panel();
            this.panel19 = new Panel();
            this.label2 = new Label();
            this.panel20 = new Panel();
            this.panel21 = new Panel();
            this.pan_LeftJianGe = new Panel();
            this.pan_Top = new Panel();
            this.panel17 = new Panel();
            this.DataGridList = new DataGridView();
            this.UserId = new DataGridViewTextBoxColumn();
            this.CreateTime = new DataGridViewTextBoxColumn();
            this.ToMeetMoney = new DataGridViewTextBoxColumn();
            this.panel16 = new Panel();
            this.panel15 = new Panel();
            this.panel14 = new Panel();
            this.panel13 = new Panel();
            this.panel9 = new Panel();
            this.panel10 = new Panel();
            this.label1 = new Label();
            this.panel11 = new Panel();
            this.panel12 = new Panel();
            this.panel5.SuspendLayout();
            this.pan_Dock.SuspendLayout();
            this.pan_NewDock.SuspendLayout();
            ((ISupportInitialize) this.DataGridListNews).BeginInit();
            this.panel8.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            this.pan_Left.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel26.SuspendLayout();
            ((ISupportInitialize) this.DataGridSalePayMent).BeginInit();
            this.panel18.SuspendLayout();
            this.panel19.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.panel17.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.panel9.SuspendLayout();
            this.panel10.SuspendLayout();
            base.SuspendLayout();
            this.panel1.BackColor = Color.White;
            this.panel1.Dock = DockStyle.Top;
            this.panel1.Location = new Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x3ae, 5);
            this.panel1.TabIndex = 0;
            this.panel2.BackColor = Color.White;
            this.panel2.Dock = DockStyle.Bottom;
            this.panel2.Location = new Point(0, 0x223);
            this.panel2.Name = "panel2";
            this.panel2.Size = new Size(0x3ae, 5);
            this.panel2.TabIndex = 1;
            this.panel3.BackColor = Color.White;
            this.panel3.Dock = DockStyle.Left;
            this.panel3.Location = new Point(0, 5);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(5, 0x21e);
            this.panel3.TabIndex = 2;
            this.panel4.BackColor = Color.White;
            this.panel4.Dock = DockStyle.Right;
            this.panel4.Location = new Point(0x3a9, 5);
            this.panel4.Name = "panel4";
            this.panel4.Size = new Size(5, 0x21e);
            this.panel4.TabIndex = 3;
            this.panel5.Controls.Add(this.pan_Dock);
            this.panel5.Controls.Add(this.panel7);
            this.panel5.Controls.Add(this.pan_Left);
            this.panel5.Dock = DockStyle.Fill;
            this.panel5.Location = new Point(5, 5);
            this.panel5.Name = "panel5";
            this.panel5.Size = new Size(0x3a4, 0x21e);
            this.panel5.TabIndex = 4;
            this.pan_Dock.BackColor = Color.White;
            this.pan_Dock.Controls.Add(this.pan_NewDock);
            this.pan_Dock.Controls.Add(this.pan_Lefts);
            this.pan_Dock.Controls.Add(this.pan_Rights);
            this.pan_Dock.Controls.Add(this.pan_Bottoms);
            this.pan_Dock.Controls.Add(this.pane_TopT);
            this.pan_Dock.Controls.Add(this.panel8);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0x11d, 0);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x287, 0x21e);
            this.pan_Dock.TabIndex = 5;
            this.pan_NewDock.Controls.Add(this.DataGridListNews);
            this.pan_NewDock.Dock = DockStyle.Fill;
            this.pan_NewDock.Location = new Point(5, 0x25);
            this.pan_NewDock.Name = "pan_NewDock";
            this.pan_NewDock.Size = new Size(0x27d, 500);
            this.pan_NewDock.TabIndex = 10;
            this.DataGridListNews.AllowUserToAddRows = false;
            this.DataGridListNews.AllowUserToDeleteRows = false;
            this.DataGridListNews.AllowUserToResizeColumns = false;
            this.DataGridListNews.AllowUserToResizeRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridListNews.AlternatingRowsDefaultCellStyle = style;
            this.DataGridListNews.BackgroundColor = Color.WhiteSmoke;
            this.DataGridListNews.BorderStyle = BorderStyle.None;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridListNews.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridListNews.Columns.AddRange(new DataGridViewColumn[] { this.id, this.Titles, this.Infos, this.NewsCreateTime });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridListNews.DefaultCellStyle = style3;
            this.DataGridListNews.Dock = DockStyle.Fill;
            this.DataGridListNews.EnableHeadersVisualStyles = false;
            this.DataGridListNews.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridListNews.Location = new Point(0, 0);
            this.DataGridListNews.Name = "DataGridListNews";
            this.DataGridListNews.ReadOnly = true;
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridListNews.RowHeadersDefaultCellStyle = style4;
            this.DataGridListNews.RowHeadersVisible = false;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridListNews.RowsDefaultCellStyle = style5;
            this.DataGridListNews.RowTemplate.Height = 0x17;
            this.DataGridListNews.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.DataGridListNews.Size = new Size(0x27d, 500);
            this.DataGridListNews.TabIndex = 10;
            this.DataGridListNews.CellClick += new DataGridViewCellEventHandler(this.DataGridListNews_CellClick);
            this.id.DataPropertyName = "id";
            this.id.HeaderText = "id";
            this.id.Name = "id";
            this.id.ReadOnly = true;
            this.id.Visible = false;
            this.Titles.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Titles.DataPropertyName = "Titles";
            style6.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style6.BackColor = Color.White;
            this.Titles.DefaultCellStyle = style6;
            this.Titles.FillWeight = 150f;
            this.Titles.HeaderText = "标 题";
            this.Titles.Name = "Titles";
            this.Titles.ReadOnly = true;
            this.Infos.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Infos.DataPropertyName = "Infos";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.Infos.DefaultCellStyle = style7;
            this.Infos.FillWeight = 130f;
            this.Infos.HeaderText = "内容简介";
            this.Infos.Name = "Infos";
            this.Infos.ReadOnly = true;
            this.NewsCreateTime.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.NewsCreateTime.DataPropertyName = "CreateTime";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.NewsCreateTime.DefaultCellStyle = style8;
            this.NewsCreateTime.FillWeight = 80f;
            this.NewsCreateTime.HeaderText = "发布时间";
            this.NewsCreateTime.Name = "NewsCreateTime";
            this.NewsCreateTime.ReadOnly = true;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 0x25);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(5, 500);
            this.pan_Lefts.TabIndex = 9;
            this.pan_Lefts.Paint += new PaintEventHandler(this.pan_Lefts_Paint);
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x282, 0x25);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(5, 500);
            this.pan_Rights.TabIndex = 8;
            this.pan_Rights.Paint += new PaintEventHandler(this.pan_Rights_Paint);
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x219);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x287, 5);
            this.pan_Bottoms.TabIndex = 7;
            this.pan_Bottoms.Paint += new PaintEventHandler(this.pan_Bottoms_Paint);
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0x20);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x287, 5);
            this.pane_TopT.TabIndex = 6;
            this.pane_TopT.Paint += new PaintEventHandler(this.pane_TopT_Paint);
            this.panel8.Controls.Add(this.pan_ZhongJian);
            this.panel8.Controls.Add(this.pan_TopRight);
            this.panel8.Controls.Add(this.pan_TopLeft);
            this.panel8.Dock = DockStyle.Top;
            this.panel8.Location = new Point(0, 0);
            this.panel8.Name = "panel8";
            this.panel8.Size = new Size(0x287, 0x20);
            this.panel8.TabIndex = 5;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x263, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x5b, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "业界最新动态";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x282, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.panel7.BackColor = Color.White;
            this.panel7.Dock = DockStyle.Left;
            this.panel7.Location = new Point(0x117, 0);
            this.panel7.Name = "panel7";
            this.panel7.Size = new Size(6, 0x21e);
            this.panel7.TabIndex = 4;
            this.pan_Left.Controls.Add(this.panel6);
            this.pan_Left.Controls.Add(this.pan_LeftJianGe);
            this.pan_Left.Controls.Add(this.pan_Top);
            this.pan_Left.Dock = DockStyle.Left;
            this.pan_Left.Location = new Point(0, 0);
            this.pan_Left.Name = "pan_Left";
            this.pan_Left.Size = new Size(0x117, 0x21e);
            this.pan_Left.TabIndex = 3;
            this.panel6.BackColor = Color.White;
            this.panel6.Controls.Add(this.panel26);
            this.panel6.Controls.Add(this.panel25);
            this.panel6.Controls.Add(this.panel24);
            this.panel6.Controls.Add(this.panel23);
            this.panel6.Controls.Add(this.panel22);
            this.panel6.Controls.Add(this.panel18);
            this.panel6.Dock = DockStyle.Fill;
            this.panel6.Location = new Point(0, 0x116);
            this.panel6.Name = "panel6";
            this.panel6.Size = new Size(0x117, 0x108);
            this.panel6.TabIndex = 2;
            this.panel26.Controls.Add(this.DataGridSalePayMent);
            this.panel26.Dock = DockStyle.Fill;
            this.panel26.Location = new Point(6, 0x25);
            this.panel26.Name = "panel26";
            this.panel26.Size = new Size(0x10b, 0xdd);
            this.panel26.TabIndex = 12;
            this.DataGridSalePayMent.AllowUserToAddRows = false;
            this.DataGridSalePayMent.AllowUserToDeleteRows = false;
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style9.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridSalePayMent.AlternatingRowsDefaultCellStyle = style9;
            this.DataGridSalePayMent.BackgroundColor = Color.WhiteSmoke;
            this.DataGridSalePayMent.BorderStyle = BorderStyle.None;
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style10.BackColor = Color.White;
            style10.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style10.ForeColor = SystemColors.WindowText;
            style10.SelectionBackColor = SystemColors.Highlight;
            style10.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridSalePayMent.ColumnHeadersDefaultCellStyle = style10;
            this.DataGridSalePayMent.Columns.AddRange(new DataGridViewColumn[] { this.GuestId, this.SalesCreateTime, this.AllMoney });
            style11.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style11.BackColor = SystemColors.Window;
            style11.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style11.ForeColor = SystemColors.ControlText;
            style11.SelectionBackColor = SystemColors.Highlight;
            style11.SelectionForeColor = SystemColors.HighlightText;
            style11.WrapMode = DataGridViewTriState.False;
            this.DataGridSalePayMent.DefaultCellStyle = style11;
            this.DataGridSalePayMent.Dock = DockStyle.Fill;
            this.DataGridSalePayMent.EnableHeadersVisualStyles = false;
            this.DataGridSalePayMent.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridSalePayMent.Location = new Point(0, 0);
            this.DataGridSalePayMent.Name = "DataGridSalePayMent";
            this.DataGridSalePayMent.ReadOnly = true;
            style12.Alignment = DataGridViewContentAlignment.BottomCenter;
            style12.BackColor = Color.White;
            style12.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style12.ForeColor = SystemColors.WindowText;
            style12.SelectionBackColor = SystemColors.Highlight;
            style12.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridSalePayMent.RowHeadersDefaultCellStyle = style12;
            this.DataGridSalePayMent.RowHeadersVisible = false;
            style13.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridSalePayMent.RowsDefaultCellStyle = style13;
            this.DataGridSalePayMent.RowTemplate.Height = 0x17;
            this.DataGridSalePayMent.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.DataGridSalePayMent.Size = new Size(0x10b, 0xdd);
            this.DataGridSalePayMent.TabIndex = 8;
            this.GuestId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestId.DataPropertyName = "GuestId";
            style14.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style14.BackColor = Color.White;
            this.GuestId.DefaultCellStyle = style14;
            this.GuestId.FillWeight = 70f;
            this.GuestId.HeaderText = "客户";
            this.GuestId.Name = "GuestId";
            this.GuestId.ReadOnly = true;
            this.SalesCreateTime.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.SalesCreateTime.DataPropertyName = "CreateTime";
            this.SalesCreateTime.FillWeight = 120f;
            this.SalesCreateTime.HeaderText = "销售时间";
            this.SalesCreateTime.Name = "SalesCreateTime";
            this.SalesCreateTime.ReadOnly = true;
            this.AllMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AllMoney.DataPropertyName = "ToMeetMoney";
            style15.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style15.BackColor = Color.White;
            this.AllMoney.DefaultCellStyle = style15;
            this.AllMoney.FillWeight = 80f;
            this.AllMoney.HeaderText = "收款金额";
            this.AllMoney.Name = "AllMoney";
            this.AllMoney.ReadOnly = true;
            this.panel25.Dock = DockStyle.Right;
            this.panel25.Location = new Point(0x111, 0x25);
            this.panel25.Name = "panel25";
            this.panel25.Size = new Size(6, 0xdd);
            this.panel25.TabIndex = 11;
            this.panel25.Paint += new PaintEventHandler(this.panel25_Paint);
            this.panel24.Dock = DockStyle.Left;
            this.panel24.Location = new Point(0, 0x25);
            this.panel24.Name = "panel24";
            this.panel24.Size = new Size(6, 0xdd);
            this.panel24.TabIndex = 10;
            this.panel24.Paint += new PaintEventHandler(this.panel24_Paint);
            this.panel23.Dock = DockStyle.Bottom;
            this.panel23.Location = new Point(0, 0x102);
            this.panel23.Name = "panel23";
            this.panel23.Size = new Size(0x117, 6);
            this.panel23.TabIndex = 7;
            this.panel23.Paint += new PaintEventHandler(this.panel23_Paint);
            this.panel22.Dock = DockStyle.Top;
            this.panel22.Location = new Point(0, 0x20);
            this.panel22.Name = "panel22";
            this.panel22.Size = new Size(0x117, 5);
            this.panel22.TabIndex = 6;
            this.panel22.Paint += new PaintEventHandler(this.panel22_Paint);
            this.panel18.Controls.Add(this.panel19);
            this.panel18.Controls.Add(this.panel20);
            this.panel18.Controls.Add(this.panel21);
            this.panel18.Dock = DockStyle.Top;
            this.panel18.Location = new Point(0, 0);
            this.panel18.Name = "panel18";
            this.panel18.Size = new Size(0x117, 0x20);
            this.panel18.TabIndex = 5;
            this.panel19.BackgroundImage = Resources.uc_title_2;
            this.panel19.Controls.Add(this.label2);
            this.panel19.Dock = DockStyle.Fill;
            this.panel19.Location = new Point(0x1f, 0);
            this.panel19.Name = "panel19";
            this.panel19.Size = new Size(0xf3, 0x20);
            this.panel19.TabIndex = 2;
            this.label2.AutoSize = true;
            this.label2.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.label2.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.label2.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.label2.Location = new Point(6, 8);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x3f, 13);
            this.label2.TabIndex = 0;
            this.label2.Text = "未收款项";
            this.panel20.BackgroundImage = Resources.uc_title_1;
            this.panel20.Dock = DockStyle.Right;
            this.panel20.Location = new Point(0x112, 0);
            this.panel20.Name = "panel20";
            this.panel20.Size = new Size(5, 0x20);
            this.panel20.TabIndex = 1;
            this.panel21.BackgroundImage = Resources.uc_title;
            this.panel21.Dock = DockStyle.Left;
            this.panel21.Location = new Point(0, 0);
            this.panel21.Name = "panel21";
            this.panel21.Size = new Size(0x1f, 0x20);
            this.panel21.TabIndex = 0;
            this.pan_LeftJianGe.BackColor = Color.White;
            this.pan_LeftJianGe.Dock = DockStyle.Top;
            this.pan_LeftJianGe.Location = new Point(0, 0x110);
            this.pan_LeftJianGe.Name = "pan_LeftJianGe";
            this.pan_LeftJianGe.Size = new Size(0x117, 6);
            this.pan_LeftJianGe.TabIndex = 1;
            this.pan_Top.BackColor = Color.White;
            this.pan_Top.Controls.Add(this.panel17);
            this.pan_Top.Controls.Add(this.panel16);
            this.pan_Top.Controls.Add(this.panel15);
            this.pan_Top.Controls.Add(this.panel14);
            this.pan_Top.Controls.Add(this.panel13);
            this.pan_Top.Controls.Add(this.panel9);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x117, 0x110);
            this.pan_Top.TabIndex = 0;
            this.panel17.Controls.Add(this.DataGridList);
            this.panel17.Dock = DockStyle.Fill;
            this.panel17.Location = new Point(6, 0x25);
            this.panel17.Name = "panel17";
            this.panel17.Size = new Size(0x10b, 0xe5);
            this.panel17.TabIndex = 10;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            this.DataGridList.AllowUserToResizeColumns = false;
            this.DataGridList.AllowUserToResizeRows = false;
            style16.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style16.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridList.AlternatingRowsDefaultCellStyle = style16;
            this.DataGridList.BackgroundColor = Color.WhiteSmoke;
            this.DataGridList.BorderStyle = BorderStyle.None;
            style17.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style17.BackColor = Color.White;
            style17.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style17.ForeColor = SystemColors.WindowText;
            style17.SelectionBackColor = SystemColors.Highlight;
            style17.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style17;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.UserId, this.CreateTime, this.ToMeetMoney });
            style18.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style18.BackColor = SystemColors.Window;
            style18.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style18.ForeColor = SystemColors.ControlText;
            style18.SelectionBackColor = SystemColors.Highlight;
            style18.SelectionForeColor = SystemColors.HighlightText;
            style18.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style18;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridList.Location = new Point(0, 0);
            this.DataGridList.Name = "DataGridList";
            this.DataGridList.ReadOnly = true;
            style19.Alignment = DataGridViewContentAlignment.BottomCenter;
            style19.BackColor = Color.White;
            style19.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style19.ForeColor = SystemColors.WindowText;
            style19.SelectionBackColor = SystemColors.Highlight;
            style19.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style19;
            this.DataGridList.RowHeadersVisible = false;
            style20.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style20;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.DataGridList.Size = new Size(0x10b, 0xe5);
            this.DataGridList.TabIndex = 9;
            this.UserId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.UserId.DataPropertyName = "UserId";
            style21.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style21.BackColor = Color.White;
            this.UserId.DefaultCellStyle = style21;
            this.UserId.FillWeight = 70f;
            this.UserId.HeaderText = "销售人员";
            this.UserId.Name = "UserId";
            this.UserId.ReadOnly = true;
            this.CreateTime.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CreateTime.DataPropertyName = "CreateTime";
            style22.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style22.BackColor = Color.White;
            this.CreateTime.DefaultCellStyle = style22;
            this.CreateTime.FillWeight = 120f;
            this.CreateTime.HeaderText = "销售时间";
            this.CreateTime.Name = "CreateTime";
            this.CreateTime.ReadOnly = true;
            this.ToMeetMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.ToMeetMoney.DataPropertyName = "ToMeetMoney";
            style23.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style23.BackColor = Color.White;
            this.ToMeetMoney.DefaultCellStyle = style23;
            this.ToMeetMoney.FillWeight = 80f;
            this.ToMeetMoney.HeaderText = "销售金额";
            this.ToMeetMoney.Name = "ToMeetMoney";
            this.ToMeetMoney.ReadOnly = true;
            this.panel16.Dock = DockStyle.Left;
            this.panel16.Location = new Point(0, 0x25);
            this.panel16.Name = "panel16";
            this.panel16.Size = new Size(6, 0xe5);
            this.panel16.TabIndex = 9;
            this.panel16.Paint += new PaintEventHandler(this.panel16_Paint);
            this.panel15.Dock = DockStyle.Right;
            this.panel15.Location = new Point(0x111, 0x25);
            this.panel15.Name = "panel15";
            this.panel15.Size = new Size(6, 0xe5);
            this.panel15.TabIndex = 8;
            this.panel15.Paint += new PaintEventHandler(this.panel15_Paint);
            this.panel14.Dock = DockStyle.Bottom;
            this.panel14.Location = new Point(0, 0x10a);
            this.panel14.Name = "panel14";
            this.panel14.Size = new Size(0x117, 6);
            this.panel14.TabIndex = 7;
            this.panel14.Paint += new PaintEventHandler(this.panel14_Paint);
            this.panel13.Dock = DockStyle.Top;
            this.panel13.Location = new Point(0, 0x20);
            this.panel13.Name = "panel13";
            this.panel13.Size = new Size(0x117, 5);
            this.panel13.TabIndex = 6;
            this.panel13.Paint += new PaintEventHandler(this.panel13_Paint);
            this.panel9.Controls.Add(this.panel10);
            this.panel9.Controls.Add(this.panel11);
            this.panel9.Controls.Add(this.panel12);
            this.panel9.Dock = DockStyle.Top;
            this.panel9.Location = new Point(0, 0);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x117, 0x20);
            this.panel9.TabIndex = 5;
            this.panel10.BackgroundImage = Resources.uc_title_2;
            this.panel10.Controls.Add(this.label1);
            this.panel10.Dock = DockStyle.Fill;
            this.panel10.Location = new Point(0x1f, 0);
            this.panel10.Name = "panel10";
            this.panel10.Size = new Size(0xf3, 0x20);
            this.panel10.TabIndex = 2;
            this.label1.AutoSize = true;
            this.label1.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.label1.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.label1.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.label1.Location = new Point(6, 8);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x5b, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "最新销售记录";
            this.panel11.BackgroundImage = Resources.uc_title_1;
            this.panel11.Dock = DockStyle.Right;
            this.panel11.Location = new Point(0x112, 0);
            this.panel11.Name = "panel11";
            this.panel11.Size = new Size(5, 0x20);
            this.panel11.TabIndex = 1;
            this.panel12.BackgroundImage = Resources.uc_title;
            this.panel12.Dock = DockStyle.Left;
            this.panel12.Location = new Point(0, 0);
            this.panel12.Name = "panel12";
            this.panel12.Size = new Size(0x1f, 0x20);
            this.panel12.TabIndex = 0;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x3ae, 0x228);
            base.Controls.Add(this.panel5);
            base.Controls.Add(this.panel4);
            base.Controls.Add(this.panel3);
            base.Controls.Add(this.panel2);
            base.Controls.Add(this.panel1);
            this.DoubleBuffered = true;
            base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            base.Icon = (Icon) resources.GetObject("$this.Icon");
            base.Name = "FrmStartup";
            this.Text = "FrmStartup";
            base.Load += new EventHandler(this.FrmStartup_Load);
            this.panel5.ResumeLayout(false);
            this.pan_Dock.ResumeLayout(false);
            this.pan_NewDock.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridListNews).EndInit();
            this.panel8.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            this.pan_Left.ResumeLayout(false);
            this.panel6.ResumeLayout(false);
            this.panel26.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridSalePayMent).EndInit();
            this.panel18.ResumeLayout(false);
            this.panel19.ResumeLayout(false);
            this.panel19.PerformLayout();
            this.pan_Top.ResumeLayout(false);
            this.panel17.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.panel9.ResumeLayout(false);
            this.panel10.ResumeLayout(false);
            this.panel10.PerformLayout();
            base.ResumeLayout(false);
        }

        protected void LoadNews()
        {
            DataTable list = NewsBll.GetList("");
            this.DataGridListNews.DataSource = list;
        }

        protected void LoadNewsSales()
        {
            try
            {
                UserEnt loginUser = PublicAppliction.LoginUser;
                DataTable dt = OrdersBll.ReturnTopDataTable(" IsBlackOut=0 and SaleVtag=2 and IsOut=1 and chainNum=" + loginUser.ChainNum, 10);
                this.DataZhuanHuan(ref dt);
                this.DataGridList.DataSource = dt;
            }
            catch (Exception)
            {
            }
        }

        protected void LoadNoSalesMoney()
        {
            try
            {
                UserEnt loginUser = PublicAppliction.LoginUser;
                DataTable dt = OrdersBll.ReturnTopDataTable(" IsBlackOut=0 and SaleVtag=1 and IsOut=1 and chainNum=" + loginUser.ChainNum, 10);
                this.DataZhuanHuan(ref dt);
                this.DataGridSalePayMent.DataSource = dt;
            }
            catch (Exception)
            {
            }
        }

        private void pan_Bottoms_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_Bottoms, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_Lefts_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_Lefts, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 0, 0);
        }

        private void pan_Rights_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_Rights, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 0);
        }

        private void pane_TopT_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pane_TopT, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 0);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        private void panel13_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel13, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 0);
        }

        private void panel14_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel14, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void panel15_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel15, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 0);
        }

        private void panel16_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel16, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 0, 0);
        }

        private void panel22_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel22, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 0);
        }

        private void panel23_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel23, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void panel24_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel24, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 0, 0);
        }

        private void panel25_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel25, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 0);
        }

        private delegate void DataNewsItemCallback();
    }
}

